require "PublicCD"
require "NormalCD"
require "PeriodCD"
require "Skill"

function Initialize(metaInfoMgr)
	for key, val in pairs(g_publicCDs) do
		metaInfoMgr:CreatePublicCD(key)
	end
	for key, val in pairs(g_normalCDs) do
		metaInfoMgr:CreateNormalCD(key)
	end
	for key, val in pairs(g_periodCDs) do
		metaInfoMgr:CreatePeriodCD(key)
	end
	for key, val in pairs(g_skills) do
		local skill = XSkill.CreateSkill(key)
		skill:SetCDID(val.m_cdID)
		skill:SetPCDID(val.m_publicCDID)
	end
end

function GetNeedTime(id)
	local cd = g_publicCDs[id] or g_normalCDs[id] or g_periodCDs[id]
	return cd.m_needTime
end

function GetStorType(id)
	local cd = g_publicCDs[id] or g_normalCDs[id] or g_periodCDs[id]
	return cd.m_storType
end

function GetStartTime(id)
	local cd = g_periodCDs[id]
	return cd.m_startTime
end

function GetUseCount(id)
	local cd = g_periodCDs[id]
	return cd.m_useCount
end

